home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / portable / leaveok.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.5 KB  |  53 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    leaveok
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_leaveok = "$Header: C:\CURSES\portable\RCS\leaveok.c 2.1 1993/06/18 20:20:16 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   leaveok()    - enable non-tracking cursor
  15.  
  16.   X/Open Description:
  17.      Normally, the hardware cursor is left at the location of the
  18.      window being refreshed.  This option allows the cursor to be
  19.      left whereever the update happens to leave it.  It is useful
  20.      for applications where the cursor is not used, since it reduces
  21.      the need for cursor motions.  If possible, the cursor is made
  22.      invisible when this option is enabled.
  23.  
  24.   PDCurses Description:
  25.      Though not explicitly stated, the cursor will be made visible
  26.      again, if leaveok() is passed a FALSE value.
  27.              (Frotz:911226 Comments?)
  28.  
  29.   X/Open Return Value:
  30.      The leaveok() function returns OK on success and ERR on error.
  31.  
  32.   X/Open Errors:
  33.      No errors are defined for this function.
  34.  
  35.   Portability:
  36.      PDCurses    int leaveok( WINDOW* win, bool bf );
  37.      X/Open Dec '88    int leaveok( WINDOW* win, bool bf );
  38.      BSD Curses    int leaveok( WINDOW* win, bool bf );
  39.      SYS V Curses    int leaveok( WINDOW* win, bool bf );
  40.  
  41. **man-end**********************************************************************/
  42.  
  43. int    leaveok( WINDOW *win, bool bf )
  44. {
  45. #ifdef PDCDEBUG
  46.     if (trace_on) PDC_debug("loaveok() - called\n");
  47. #endif
  48.  
  49.     if  ((win->_leave = bf) != 0)    cursoff();
  50.     else                curson();
  51.     return( OK );
  52. }
  53.